<{include file="public/member_header" /}>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <{include file="public/member_main" /}>
  <!-- sidebar end -->
  <!-- content start -->
 <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
       <div class="am-fl am-cf">
		<strong class="am-text-warning am-text-lg">修改密码</strong>
	</div>
    </div>
	<hr>
       <form class="form-horizontal" role="form" id="userInfo" name="changeMemberPwd" method="post">
		<!-- #section:elements.form -->
 		<div class="am-u-sm-8" style="margin-bottom: 1rem;">
			<label class="am-u-sm-2 am-form-label" for="form-input-readonly" style="font-weight: initial;">当前密码： </label>
			<div class="col-sm-6">
				<input  type="password" placeholder="请输入原始密码"  name ="MemberPwd" class="am-form-field am-active" id="form-input-readonly" required autocomplete="off" />
			</div>
		</div>
 
		<div class="am-u-sm-8" style="margin-bottom: 1rem;">
			<label class="am-u-sm-2 am-form-label" for="form-field-1" style="font-weight: initial;"> 新密码：</label>
			<div class="col-sm-6">
				<input type="password" id="form-field-1" required pattern="^[a-zA-Z0-9_]{6,16}$" autocomplete="off" name="NewMemberPwd" placeholder="至少6位数组或字母组成" class="am-form-field" />
			</div>
		</div>
		<div class="am-u-sm-8" style="margin-bottom: 1rem;">
			<label class="am-u-sm-2 am-form-label" for="form-field-1-1" style="font-weight: initial;">确认新密码： </label>
			<div class="col-sm-6">
				<input type="password" id="form-field-1-1" placeholder="请与上面密码保持一致"  name="NewMemberPwds" class="am-form-field" required  data-equal-to="#form-field-1" autocomplete="off"/>
			</div>
		</div>
		<div class="clearfix form-actions">
			<div class="col-md-offset-2 col-md-9">
				<button class="am-btn am-btn-primary" type="button" id="commit">
					<i class="ace-icon fa fa-check bigger-110"></i>
					立即提交
				</button>
				<button class="am-btn" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i>
					重置
				</button>
			</div>
		</div>
		</form>
    </div>
  </div>
  <!-- content end -->
</div>
<{include file="public/member_footer" /}>
 <script>
$('#commit').click(function () {
    var obj = $("form[name='changeMemberPwd']").serialize();
    $.ajax({
        type: "POST",
        url: "<{:url('changepassword')}>",
        data: obj,
        success:function(Result) {
            if (Result.code == '0') {
               alert(Result.msg,{time:2000},function () {
                    window.location.reload();
                });
            } else {
                alert(Result.msg);
            }
        }
    });
})
</script>
</body>
</html>